//
// Created by LvenLiu on 2022/3/25.
//

#ifndef FFMPEGDEMO_JNICALLBACK_H
#define FFMPEGDEMO_JNICALLBACK_H

#include <jni.h>

#define THREAD_MAIN 1 // 主线程
#define THREAD_CHILD 2 // 子线程

class JNICallback {
private:
    JavaVM *vm = 0;
    JNIEnv *env = 0;
    jobject obj = 0;
    jmethodID jmd_prepared = 0;
    jmethodID jmd_error = 0;
public:
    JNICallback(JavaVM *vm, JNIEnv *env, jobject obj);

    ~JNICallback();

public:
    void onPrepared(int thread_mode);

    void onError(int thread_mode, int error_code, char *msg);
};


#endif //FFMPEGDEMO_JNICALLBACK_H
